package com.ht.feign;

import com.ht.data.Result;
import com.ht.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;


@FeignClient(value = "ht-user-service")
public interface UserFeign {


    //用户登录
    @PostMapping("/user/login")
    Result login(@RequestBody User user, HttpSession session);

    //发送短信
    @PostMapping("/user/getCode/{phoneNum}")
    Result getCode(@PathVariable String phoneNum);

    //注册
    @PostMapping("/user/register")
    Result register(@RequestBody User user);

    //退出登录
    @GetMapping("/user/logout")
    Result logout();

    //修改密码
    @PutMapping("/user/updateUser")
    Result updateUser(@RequestHeader("AuthToken")String token, @RequestBody User user1);

    //通过用户注册的手机号删除账号
    @DeleteMapping("/user/delete")
    Result delete(@RequestHeader("AuthToken")String token,@RequestParam("phoneNum") String phoneNum,@RequestParam("messageCode")String messageCode);

    //查询用户余额
    @GetMapping("/user/balance")
    Result getBalance(@RequestHeader("AuthToken")String token);

    //用户看病日记增加
    @PostMapping("/cureDiary/insertDiary")
    Result insertDiary(@RequestHeader("AuthToken")String token, @RequestBody CureDiary cureDiary);

    //查询和用户相关的看病日记
    @GetMapping("/cureDiary/getMyDiary")
    Result getMyDiary(@RequestHeader("AuthToken") String token);

    //用户用药日记增加
    @PostMapping("/medicationDiary/insertDiary")
    Result insertDiary(@RequestHeader("AuthToken")String token, @RequestBody MedicationDiary medicationDiary);

    //查询和用户相关的用药日记
    @GetMapping("/medicationDiary/getMyDiary")
    Result getMedicationDiary(@RequestHeader("AuthToken")String token);

    //查询已预约的药单
    @GetMapping("/drug/getDrug")
     Result getDrug(@RequestHeader("AuthToken")String token );

    //用户在线服务评价
    @PostMapping("/evaluation/serviceEvaluation")
    Result createServiceEvaluation(@RequestHeader("AuthToken")String token, @RequestBody ServiceEvaluation serviceEvaluation);

    //用户诊后评价的信息
    @PostMapping("/evaluation/clinicalEvaluation")
    Result createClinicalEvaluation(@RequestHeader("AuthToken")String token, @RequestBody ClinicalEvaluation clinicalEvaluation);

    //查询我收藏的文章
    @GetMapping("/evaluation/selectArticle")
    Result selectArticle(@RequestHeader("AuthToken")String token);

    //查询用户收藏的帖子
    @GetMapping("/evaluation/selectPosts")
    Result selectPosts(@RequestHeader("AuthToken")String token);

    //查询和用户操作相关的医生
    @GetMapping("/myDoctor/getMyDoctor/{status}")
    Result getMyDoctor(@RequestHeader("AuthToken")String token,@PathVariable("status")String status);

    //新增我的医生
    @PostMapping("/myDoctor/insertDoctor/{refinance}")
    Result insertDoctor(@RequestHeader("AuthToken")String token, @RequestBody MyDoctor doctor, @PathVariable("refinance")Long refinance);

    //根据状态查询订单
    @GetMapping("/order/getOrderStatus/{status}")
    Result getOrderStatus(@RequestHeader("AuthToken")String token, @PathVariable("status")String status);

    //查询发票状态
    @PostMapping("/getInvoiceStatus/{invoiceStatus}")
    Result getInvoiceStatus(@RequestHeader("AuthToken")String token, @PathVariable("invoiceStatus")String invoiceStatus);

    //患者管理的查询
    @GetMapping("/patient/getPatient")
    Result getPatient(@RequestHeader("AuthToken")String token);

    //患者管理的增加
    @PostMapping("/patient/insertPatient")
    Result insertPatient(@RequestHeader("AuthToken")String token,@RequestBody Patient patient);

    //修改患者信息
    @PutMapping("/patient/updatePatient")
    Result updatePatient(@RequestHeader("AuthToken")String token,@RequestBody Patient patient);

    //根据id删除患者信息
    @DeleteMapping("/patient/deletePatient/{id}")
    Result deletePatient(@PathVariable("id") Long id);

    //所有患者和处方的查询
    @GetMapping("/prescription/getPrescription")
    Result getPrescription(@RequestHeader("AuthToken")String token);

    //查询患者康复任务的完成状态
    @GetMapping("/rehabilitationTask/RehabilitationTaskStatus/{status}")
    Result RehabilitationTaskStatus(@RequestHeader("Authtoken")String token,@PathVariable("status") String status);

    //根据状态查询用户收藏的医院
    @GetMapping("/tbUserCollect/getHospital")
    Result getHospital(@RequestHeader("AuthToken")String token);


}
